<?php
require_once 'class/admin.php';
//require_once 'class/staff.php';
//require_once 'class/roster.php';
require_once 'libs/configTest.php';
//require_once 'class/test1.php';;

/*
 * This is the simulation of real steps
 * ---first time initial data------start --------
 * step0:Run DB script to create database "roster_users",
 * step1:Insert(regist)first admin account---filled in table
 * step2:Name roster project by unique name---will create new DB on that name.
 * step3:initial duties array, and roster time range then create individual roster and duty tables
 * step4:initial participanter's by type or inport xml sheel of data into "roster_users" DB
 * step5:user login to initial their favour duties and exception date.
 * step6:system caculate the roster.
 * ------inital data -------end--------
 * ----second time---start-----
 * step7:admin start new roster.
 * step8:users login to fill in their exception date.----option, they could change their prefer duties array
 * step9: admin generate newroster.
 * -----second time---end-----
 * 
 *------new Admin register--------------
 * 
 */

//step1 start

$testConfig = new DBconfigTest();

$GiveName="Grace";
$Surname = "Guo";
$Email = "graceguo2625@gmail.com";
$PW = sha1("1234");
$testConfig->registerAdmin($GiveName, $Surname, $Email, $PW);//1
//step1 end
//step1 testing 
    $adminTesting = new admin($Email, $PW);//2

//step2 start

$newDBName = 'NewDB'; // get from the admin interface;
$testConfig->initalDB($newDBName);//3
echo '----------------------<br>';
$adminTesting->updateRosterDBToUserDB($newDBName);//4   
echo '----------------------<br>';


//step2 end

//step3 start  

$tempDutiesArray = array(
    'reading','writing','speaking','listerning','testing'
);


$tempStartDate = '2013/02/01';
$tempEndDate = '2013/03/24';
$adminTesting->initialRosterTable($tempDutiesArray, $tempStartDate, $tempEndDate);




//step 3 end


//$admin->initalRoster();
//$admin->getSundayArray();

/*
$staff1 = new staff('Grace', '1234');

 * 
 */
//$admin->setRosterDutiesArray($tempDutiesArray);

//$admin->getRosterDutiesArray();



//$admin->showRosterDutiesArray();
//echo '------------------------------------------------------';


//$admin->showRosterDutiesArray();

/*

$tempWillingArray = array('reading','listerning');
$staff1->setWillingArray($tempWillingArray);
$staff1->showWillingArray();

$tempUnableArray = array('2013/02/17','2013/02/24');
$staff1->setUnableArray($tempUnableArray);
$staff1->showUnableArray();
echo '=------------------';
$admin->firstTimeCreateRosterDB();
 * /
 */

//$admin->caculateSundays();
//$admin->checkpw("Mark","12344");

//$test = new test2();
//$test->fn();
?>
